package com.tencent.wxcloudrun.service.impl;

import com.tencent.wxcloudrun.dao.HxUserMapper;
import com.tencent.wxcloudrun.model.HxUser;
import com.tencent.wxcloudrun.service.HxUserService;
import org.springframework.stereotype.Service;

import java.util.Optional;

@Service
public class HxUserServiceImpl implements HxUserService {

    final HxUserMapper hxUserMapper;

    public HxUserServiceImpl(HxUserMapper hxUserMapper) {
        this.hxUserMapper = hxUserMapper;
    }

    @Override
    public Optional<HxUser> getUser(String uid) {
        return hxUserMapper.getUser(uid);
    }

    @Override
    public Optional<HxUser> getUserById(Integer id) {
        return hxUserMapper.getUserById(id);
    }

    @Override
    public void addUser(HxUser user) {
        hxUserMapper.addUser(user);
    }

    @Override
    public void collectGift(Integer id) {
        hxUserMapper.collectGift(id);
    }
}
